package com.yjj.demo.common.utils;

import org.joda.time.Days;
import org.joda.time.LocalDate;

import java.util.Date;

/**
 *
 *
 * @author yangjiajia
 * @createdAt 2023/2/27 11:20
 */
public class DateUtil {

    public static int betweenDay(LocalDate date) {
        LocalDate currentDate = LocalDate.now();
        Days days = Days.daysBetween(date, currentDate);
        return days.getDays();
    }

    public static void main(String[] args) {
//        Date date = new Date(1677288873000L);
//        LocalDate localDate = LocalDate.fromDateFields(date);
//        int days = betweenDay(localDate);
//        System.out.println(days);
        DateUtil.startTime();
    }

    public static long startTime() {
        Date startTime = LocalDate.now().toDate();
        Date endTime = LocalDate.now().plusDays(1).toDate();
        System.out.println(startTime);
        System.out.println(endTime);
        return 0L;
    }
}
